import { request } from "../util/request.js";

export default {
    add: async (schedule) => {
        return await request({
            type: "post",
            url: '/api/schedules',
            data: schedule,
        })
    },
    updata: async (schedule) => {
        return await request({
            type: "put",
            url: `/api/schedules/${schedule._id}`,
            data: schedule,
        })
    },
    delete: async (_id) => {
        return await request({
            type: "delete",
            url: `/api/schedules/${_id}`,
        })
    },
    getOne: async (_id) => {
        return await request({
            type: "get",
            url: `/api/schedules/${_id}`,
        })
    }
}